home *** CD-ROM | disk | FTP | other *** search
/ Supercompiler 1997 / SUPERCOMPILER97.iso / BC++ Builder / DATA.Z / IBEVNTS.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1997-02-10  |  1.6 KB  |  48 lines

  1. //---------------------------------------------------------------------------
  2. // Borland C++Builder
  3. // Copyright (c) 1987, 1997 Borland International Inc.  All Rights Reserved.
  4. //---------------------------------------------------------------------------
  5. // ibevnts.cpp
  6. // This file is #included in IBREG.CPP which #includes IBREG.H which
  7. // in turn #includes INEVNTS.H.  Hence #including IBEVNTS.H here is redundant with
  8. // no ramifications (there are sentries in the header file) but has been done
  9. // just to clarify that the function and class implementations in this file are
  10. // prototyped in INEVNTS.H
  11. #include <memory>     //for STL auto_ptr
  12. #if !defined (REGISTER_ALL_CONTROLS)
  13.   #include  "ibevnts.h"
  14. #else
  15.   #include "source\ibevnts.h"
  16. #endif
  17. #pragma resource "*.dfm"
  18.  
  19. bool __fastcall Ibevnts::EditAlerterEvents(Classes::TStrings *Events)
  20. {
  21.   bool result = false;
  22.   std::auto_ptr<TIBEAEventsEditor> EEditor(new TIBEAEventsEditor(Application));
  23.   for(int i=0; i < Events->Count ;i++) //
  24.   {
  25.     EEditor->cEvents->Cells[1][i] = Events->Strings[i];
  26.   }
  27.   if( EEditor->ShowModal() == IDOK )
  28.   {
  29.     result = true;
  30.     Events->Clear();
  31.     for(int i=0; i < MaxEvents ;i++)
  32.     {
  33.       if ((EEditor->cEvents->Cells[1][i].Length()) != 0)
  34.         Events->Add( EEditor->cEvents->Cells[1][i]);
  35.     }
  36.   }
  37.   return result;
  38. }
  39.  
  40. void __fastcall TIBEAEventsEditor::FormCreate(TObject *Sender)
  41. {
  42.   for(int i=1; i < MaxEvents; i++ ) 
  43.       cEvents->Cells[0][i-1] = AnsiString(i);
  44.   RequestedEvents->Caption = LoadStr(57810);
  45.   bOK->Caption = LoadStr(57811);
  46.   bCancel->Caption = LoadStr(57812);
  47. }
  48.